import request from '@/utils/request'

// 获取用户优惠券列表
export function getUserCouponList(params) {
  return request({
    url: '/marketing/userCoupon/list',
    method: 'get',
    params
  })
}

// 使用优惠券
export function useCoupon(data) {
  return request({
    url: '/coupon/use',
    method: 'post',
    data
  })
}

// 删除优惠券
export function deleteCoupon(id) {
  return request({
    url: `/coupon/delete/${id}`,
    method: 'post'
  })
}

// 获取可领取的优惠券列表
export function getCouponList(params) {
  return request({
    url: 'marketing/coupon/getList',
    method: 'get',
    params
  })
}

// 领取优惠券
export function receiveCoupon(id) {
  return request({
    url: `/coupon/receive/${id}`,
    method: 'post'
  })
}